﻿
@{
    ViewBag.Title = "Edit";
    Layout = "~/Areas/Manager/Views/Shared/ManagerLayout.cshtml";
}
<title>增减电子币</title>
<article class="page-container">

    <form class="form form-horizontal" id="form1">
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>会员编号：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" value="" placeholder="请输入会员编号" required id="UserCode" name="UserCode">
            </div>
        </div>

        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">类型：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <select class="input-text" name="Type" id="Type">
                    <option value="0">增加电子币</option>
                    <option value="1">减少电子币</option>
                </select>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>金额：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" value="" placeholder="请输入金额" required id="Amount" name="Amount">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">备注：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" value="" placeholder="备注" id="Sort" name="Remark">
            </div>
        </div>
        <div class="row cl">
            <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
                <button class="btn btn-primary radius" type="submit"><i class="Hui-iconfont">&#xe632;</i> 提交</button>
            </div>
        </div>
    </form>
</article>

<!--请在下方写此页面业务相关的脚本-->
<script src="~/DirectSellJs/manager/lib/ueditor/ueditor.config.js"></script>
<script src="~/DirectSellJs/manager/lib/ueditor/ueditor.all.min.js"></script>
<script src="~/DirectSellJs/manager/lib/ueditor/lang/zh-cn/zh-cn.js"></script>
<script type="text/javascript">
$('#form1').on('submit', function () {
    formPost()
    event.preventDefault() //阻止form表单默认提交
})
function formPost() {
    layer.confirm('确定要执行本操作吗？', {
        btn: ['确定', '取消'] //按钮
    }, function () {
        //加载层
        var index = layer.load(1, {
            shade: [0.1, '#fff']
        });
        $.ajax({
            type: "post",
            url: "/Manager/VirtualMoneyAudit/Allowance",
            data: $('#form1').serialize(),
        }).success(function (message) {
            if (message == "操作成功,请审核") {
                window.parent.location.reload();//刷新父页面
            }
            else {
                layer.msg(message, { icon: 2 });
            }
        }).fail(function (err) {
            console.log(err);
            layer.msg('系统错误,请稍后重试!', { icon: 2 });
        })
        layer.closeAll();//关闭加载层
    });
}

</script>